/************************************************************************
 * This module define the Class serialport,The Class serialport
 * is the abstract of the serial port.you can use the Class serialport
 * control the serial port.
 * The author:Zhang YongChang
 * The Date:2012-2-20
 * CopyRight @ robot loving team.
 ************************************************************************/

#ifndef SERIALPORT_H
#define SERIALPORT_H

#include "serialportbase.h"

#define MAX_SIZE_COMMAND 1024

namespace robot {

enum state {
	open_state, close_state
};

class Serialport {
public:
	Serialport(const char *serialport_name);
	~Serialport();

	void write(const char *buf, int length);
	void read(char *buf, int length);

	state is_open();
private:
	hdevice hDev;
	state m_state;
};
}
#endif
